<template>
	<view class="error_box">
		<view class="error">
			<view class="error_image_box">
				<image class="error_image" src="/static/icon/error.png" />
			</view>
			<text class="error_text">{{error}}</text>
		</view>
		<navigator class="error_nav" url="/pages/main/main" open-type="reLaunch">返回首页</navigator>
	</view>
</template>

<script>
	export default {
		data: () => ({
			error: ''
		}),
		onLoad(options) {
			this.error = options.error
		},
		onBackPress(e) {
			uni.reLaunch({
				url: '/pages/main/main'
			})
			return true
		},
	}
</script>

<style lang="less">
	.error_box {
		box-sizing: border-box;
		padding-top: 300upx;
		width: 100vw;
		height: 100vh;
		// background: rgba(0, 0, 0, .4);

		.error {
			margin: 0 auto;
			display: flex;
			align-items: center;
			flex-direction: column;
			box-sizing: border-box;
			width: 80vw;
			padding: 50upx 100upx;
			border-radius: 10upx;
			background: #FFFFFF;

			.error_image_box {
				display: flex;
				justify-content: space-around;
				align-items: center;
				width: 100upx;
				height: 100upx;
				background: #ec6663;
				border-radius: 50upx;

				.error_image {
					width: 80upx;
					height: 80upx;
				}
			}

			.error_text {
				margin-top: 60upx;
				font-size: 35upx;
				color: #333;
			}
		}

		.error_nav {
			margin: 200upx auto 0;
			width: 250upx;
			height: 60upx;
			line-height: 60upx;
			border: 1px solid #02A8F4;
			border-radius: 30upx;
			font-size: 30upx;
			color: #02A8F4;
			text-align: center;
		}
	}
</style>
